<?php
/**
 * RUBIK IT Solution & Development Co.ltd,
 *
 * PROJECT		: Auction
 * COPYRIGHT	: 2010
 * ------------------------------------------------------
 * 
 * DTO class of  #__member table
 *
 * @author			generator <hoadn@rubik.com.vn>
 * @access			public
 * @package			dbo.MemberDTO
 *
 * Created on	: September 13, 2010
 */

// Importer
RCoreImporter::cls( "dbo.AbstractDTO" );

/**
 * @name MemberDTO
 * The data transfer object class for table: #__user
 */
class MemberViewDTO extends AbstractDTO {
	
	// Keys
	var $user_id	= "N*|||key";
	
	// Colums
	var $fullname		= "S*||u";
	var $business_name	= "S||u";
	var $address		= "S*||u";
	var $state			= "S||s|name";
	var $state_id		= "N*||u";
	var $city			= "S||c|name";
	var $city_id		= "N*||u";
	var $zip_code		= "S*||u";
	var $contact_tel	= "S*||u";
	var $work_tel		= "S||u";
	var $credit_card	= "S||u";
	var $birthday		= "D||u";
	var $photo			= "S||u";
	var $terms_conditions = "T||u";
	var $howtobuy 		= "T||u";
	
	var $username		= "S&u*||u";
	var $password		= "MD5*||u";
	var $user_group_id	= "N*||u";
	var $user_group_code= "S*||u";
	var $email	 		= "EM*||u";
//	var $email			= "EM*&u*||u";
	var $activate		= "B|0|u";
	var $activation_code= "S||u";
	var $date_join		= "D*|NOW|u";
	var $deleted		= "B|0|u";	
	
	
	/**	
	 * Constructor	
	 *	
	 * @param string $where	 the where string (without WHERE)
	 * @param string $orderBy the other by string (with order by)
	 * @param DataBase $db the database (if null the database of system will be specify)
	 */	
	function __construct($where='', $orderBy = '', $db = null) {	
		parent::__construct('FROM user u 
							LEFT JOIN state s ON u.state_id = s.state_id 
							LEFT JOIN city c ON u.city_id = c.city_id 
							', ' u.user_group_code<>"admin" AND u.deleted=0 ', $orderBy, $db);
	}	
}
?>